<?php
//-------------------------------------------------------------------------------------------------------
    require_once($config['mailer']['path'] . 'class.phpmailer.php');
    //---------------------------------------------------------------------------------------------------
    class objMailer extends phpMailer{
        function __construct() {
            $this->SetGlobalSettings();
        }// constructor

        public function SetGlobalSettings() {
          global $config;

            if ( 'smtp'==strtolower($config['mailer']['type']) )    $this->IsSMTP();
            elseif( 'mail'==strtolower($config['mailer']['type']) ) $this->IsMail();
            elseif( 'qmail'==strtolower($config['mailer']['type']) ) $this->IsQmail();
            elseif( 'sendmail'==strtolower($config['mailer']['type']) ) $this->SendMail();

            $this->Host = $config['mailer']['host'];  // specify main and backup server
            $this->CharSet = $config['mailer']['charset'];
            $this->Priority = $config['mailer']['priority'];
            $this->Port = $config['mailer']['port'];

            if ( $config['mailer']['username'] ) {
                $this->SMTPAuth = true;     // turn on SMTP authentication
                $this->Username = $config['mailer']['username'];  // SMTP username
                $this->Password = $config['mailer']['password']; // SMTP password
            }
            $this->From = $config['mailer']['from'];
            $this->FromName = $config['mailer']['fromName'];
            $this->SetLanguage('en', $config['mailer']['path'] . 'language\\');
        } //setGlobalSettings

    } //class Mailer
//-------------------------------------------------------------------------------------------------------
?>
